﻿using MediatR;
using T.Basic.API.Appliction.Command.OutsourcedUnitsCommand;
using T.Basic.Domain.T.Basic.Model;
using T.Basic.Repository.BasicInterface;

namespace T.Basic.API.Appliction.CommandHandlers.OutsourcedUnitsHanders
{
    /// <summary>
    /// 反填外协单位信息
    /// </summary>
    public class OutsourcedUnitsGetByidCommandHander : IRequestHandler<OutsourcedUnitsGetByidCommand, OutsourcedUnits>
    {
        private readonly IOutsourcedUnitsRepository _outsourcedUnitsRepository;
        public OutsourcedUnitsGetByidCommandHander(IOutsourcedUnitsRepository outsourcedUnitsRepository)
        {
            _outsourcedUnitsRepository = outsourcedUnitsRepository;
        }
        public async Task<OutsourcedUnits> Handle(OutsourcedUnitsGetByidCommand request, CancellationToken cancellationToken)
        {
            return await _outsourcedUnitsRepository.GetModelsAsync(request.OutsourcedUnitsId);
        }
    }
}
